<template>
    <div>
        <el-input></el-input>
        <el-button @click="checkButton">{{ props.title }}</el-button>
    </div>
</template>

<script lang='ts' setup>
// 约束父组件传递过来参数
const props = defineProps<{ title: string, msg: string, index?: number }>()
console.log(props);

//约束自定义事件名字、函数的参数
const $emit = defineEmits<{
    (e: "getChildValue", val: string): void
}>()

const checkButton = () => {
    $emit("getChildValue", "点击后文本")
}




</script>

<style lang='scss' scoped></style>